<template>
  <el-col
    :span="4"
    style="background-color: #f5f3f2; padding: 10px;"
  >
    <el-row
      v-for="(item, index) in classify"
      :key="index"
      class="type"
      @click="this.$router.push({path: '/search', query: {type: item.typeId}})"
    >
      {{ item.name }}
    </el-row>
  </el-col>
</template>

<script>
import { typeAll } from "@/api/type";

export default {
  data() {
    return {
      classify: [],
    };
  },
  methods: {
    all() {
      typeAll(0, 100).then((res) => {
        this.classify = res.list;
      });
    },
  },
  created() {
    this.all();
  },
};
</script>

<style scoped>
.type {
  font-size: 16px;
  margin: 5px 0;
  cursor: pointer;
}

.type:hover {
  color: #3271ae;
}
</style>